/*
 * View.h
 *
 *  Created on: 03/05/2011
 *      Author: DessaVida
 */

#ifndef VIEW_H_
#define VIEW_H_

#include "component/Direction.h"
#include "Model.h"

#include "sprite.hpp"
#include "core/Camera.h"
using namespace e2d::graphics;

class View {
private:
	int type;
	int current;
	Sprite *sprite;
	bool repeating;
	int direction;
	int state;
	string normalSprite;
	string attackSprite;

	int n_animation;
	map<int, map<int, int> > idList;
public:
	View();
    View(string normalSprite, string *attackSprite = NULL);
    virtual ~View();

    void update(Model *model, Camera *camera);
    int getCurrent();
    void setState(int state);
    void setDirection(Direction *dir);
    bool getRepeating() const;
    void setRepeating(bool repeating);
    Sprite *getSprite() const;
    void setSprite(Sprite *sprite);
    int getAnimation() const;
    void setAnimation(int n_animation);
    static const unsigned int IDLE = 0;
    static const unsigned int WALK = 1;
    static const unsigned int RUN = 2;
    static const unsigned int HITTED = 3;
    static const unsigned int DIE = 4;
    static const unsigned int SWORD = 0;
    static const unsigned int BOW = 1;
    static const unsigned int GUN = 2;
    static const unsigned int NORMAL = 0;
    static const unsigned int ATTACK = 1;
    static const unsigned int SOUTH = 0;
    static const unsigned int EAST = 1;
    static const unsigned int NORTH = 2;
    static const unsigned int WEST = 3;
    int getType() const;
    void setType(int type);

	void loadThings(int type);
};

#endif /* VIEW_H_ */
